﻿@model List<KRM.Core.tblWebsiteEmailSubject>
@{
    ViewBag.Title = "Manage email subject";
    Layout = "~/Views/Shared/_PopupLayout.cshtml"; 
}

<div style="padding: 20px;">
    @Html.Partial("Partial/_MessageResult")
    <form action="/orderview/createemailsubject" method="POST">
        <input type="hidden" name="orderid" value="@ViewBag.OrderId"/>
        <div class="row-fluid">
            <div style="padding: 20px">
                <div class="row-fluid">
                    <div class="span3">SubjectName</div>
                    <div class="span9">
                        <input type="text" name="subjectname" />
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span3">
                    </div>
                    <div class="span9">
                        <button class="btn btn-primary" type="submit">Create</button>
                        <a href="/orderview/contactcustomer/@ViewBag.OrderID" class="btn" style="margin-left: 20px">Back</a>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <table class="table table-hover table-bordered table-fix" style="font-size: 13px">
        <thead>
            <tr>
                <th>Subject Name</th>
                <th>Delete</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        <form action="/orderview/EditEmailSubject" method="POST" class="noMargin">
                            <input type="hidden" name="id" value="@item.Id"/>
                            <input type="hidden" name="orderid" value="@ViewBag.OrderId"/>
                            <input type="text" name="subjectname" value="@item.SubjectName" style="margin: 0" class="pull-left"/>
                            <button type="submit" class="btn-link">Cập nhật</button>
                        </form>
                    </td>
                    <td><a href="/orderview/deleteemailsubject/@item.Id?orderid=@ViewBag.OrderId">Delete</a></td>
                </tr>
            }
        </tbody>
    </table>
</div>

